﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pibby.Core.IO;
using invrt;

namespace Pibby.UI
{
	public partial class PortableDeviceContentView : UserControl
	{
		public PortableDeviceContentView()
		{
			InitializeComponent();
		}

		public void InitialiseUI()
		{
			this.mp3ContentListView.Configure();

			this.mp3ContentListView.SmallImageList = imageList1;
		}

		public void RefreshContent(string driveName)
		{
			var driveFactory = InversionOfController.Factory.CreateTypeOf<IDriveFactory>();
			var drive = driveFactory.GetDriveByName(driveName);

			var folderFactory = InversionOfController.Factory.CreateTypeOf<IFolderFactory>();
			var rootFolder = folderFactory.GetFolder(drive.Name);

			this.mp3ContentListView.RefreshContent(rootFolder);
		}

		public void ClearContent()
		{
			this.mp3ContentListView.ClearContent();
		}
	}
}
